package com.forenow.demo.ListTest;

import java.util.*;

public class test {
    public static void main(String[] args) {
        Student stu1=new Student(1,"tom","male",18,78);
        Student stu2=new Student(2,"cindy","female",19,82);
        Student stu3=new Student(3,"bob","male",17,93);
        Student stu4=new Student(4,"wei","male",20,92);
        Student stu5=new Student(5,"li","male",18,89);
        Student stu6=new Student(6,"wang","female",19,93);
        Map<Integer,Student> map1=new HashMap<>();
        Map<Integer,Student> map2=new HashMap<>();
        Map<Integer,Student> map3=new HashMap<>();
        List<Map<Integer,Student>> list=new ArrayList<>();
        map1.put(1,stu1);
        map1.put(2,stu2);
        map2.put(3,stu3);
        map2.put(4,stu4);
        map3.put(5,stu5);
        map3.put(6,stu6);
        list.add(map1);
        list.add(map2);
        list.add(map3);
        for (Map<Integer, Student> studentMap : list) {
            Set<Map.Entry<Integer, Student>> set = studentMap.entrySet();
            for (Map.Entry<Integer, Student> next : set) {
                System.out.println(next.getValue());
            }
        }
    }
}
